package com.example.interesting.distributed.lock.realize.strategy;

import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Method;

/**
 * @author fyw
 * @version 1.0
 * @description: 分布式锁获取失败默认处理策略
 * @date 2024/3/16 13:21
 */
@Slf4j
public class DefaultDistributedLockFailureStrategy implements DistributedLockFailureStrategy {

    @Override
    public void onLockFailure(String key, Method method, Object[] arguments, String failMsg) {
        log.warn("分布式锁获取失败：key={}，method={}，arguments={}，failMsg={}", key, method, arguments, failMsg);
        throw new RuntimeException(failMsg);
    }
}
